package com.jb.security;

import com.jb.faces.context.FacesContext;
import com.jb.web.session.SessionUser;


/**
 * Authenticator is reponsible for autheticate an user and invalidate a user.
 */
public interface Authenticator {
    /**
     * Authenticates an user by credentials.
     * @param ctx 
     * @param userName
     * @param password
     * @return a session user if authenticated.
     */
    public SessionUser login(FacesContext ctx, String userName, char[] password);
    /**
     * Signs off a user.
     * @param ctx FacesContext 
     * @param user to be logged out.
     */
    public void logout(FacesContext ctx, SessionUser user);
}
